package com.example.demo.myThread;

import java.util.Vector;

public class TestViecor {

    public static void main(String[] args) throws InterruptedException {

        Vector<Integer> v = new Vector<>();
        for (int i = 0 ;i<100000;i++){
            v.add(i);
        }
        Thread.sleep(5000);
        new Thread(()->{
            for (int i:v){
                System.out.println(i);
            }
        }).start();
        new Thread(()->{
            for (int i = 100000;i<200000;i++){
                v.add(i);
            }
        }).start();
    }

}
